﻿/*
 * Copyright 2014 Francois Karman
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

using System.Diagnostics;
using System.Web.Optimization;

namespace Quartz.WebManager.Web
{
    /// <summary>
    /// Manages the bundles of the application.
    /// </summary>
    public class BundleConfig
    {
        /// <summary>
        /// Registers all the bundles (css and js) used by the application.
        /// </summary>
        /// <param name="bundles">The bundles collection to update.</param>
        public static void RegisterBundles(BundleCollection bundles)
        {
            // JS
            bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                        "~/Scripts/jquery-{version}.js",
                        "~/Scripts/jquery.validate.js",
                        "~/Scripts/jquery.validate.unobtrusive.js",
                        "~/Scripts/site.validate.js"));
            bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                        "~/Scripts/modernizr-*"));
            bundles.Add(new ScriptBundle("~/bundles/spin").Include(
                        "~/Scripts/spin.js"));
            bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
                        "~/Scripts/bootstrap.js",
                        "~/Scripts/moment.js",
                        "~/Scripts/bootstrap-datetimepicker.js",
                        "~/Scripts/bootstrap-table.js",
                        "~/Scripts/bootbox.js",
                        "~/Scripts/jquery.validate.unobtrusive.bootstrap.js",
                        "~/Scripts/respond.js"));

            // CSS
            bundles.Add(new StyleBundle("~/Content/css").Include(
                        "~/Content/bootstrap.css",
                        "~/Content/bootstrap-datetimepicker.css",
                        "~/Content/bootstrap-table.css",
                        "~/Content/font-awesome.css",
                        "~/Content/site.css"));

            BundleTable.EnableOptimizations = !Debugger.IsAttached;
        }
    }
}
